/***************************************************************************
 创建者: 华磊
 开始时间: 2020.3.1
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) hualei 2020.5.8 类的具体实现代码编写

 ***************************************************************************
 *  @file x.h
 *  功能:
 *
 *                                                                         *
 ***************************************************************************/

#ifndef FOLLOWMOTION_H
#define FOLLOWMOTION_H
#include "GeneralDefine.h"
#include <QQueue>

class AxisObject;
class MotionMessage;

class FollowMotion
{
public:
    FollowMotion(double deltaTimeIn,MotionMessage *motionMessageIn);

public:
    int startFollow();
    int setFollowSpeed(double speedIn);
    int setOrientationStrategy(int strategy);
    int setEndPoint(PointPro pointIn);//离该点距离最近,则结束.
    int addDetectPoint(PointPro pointIn);
    int reset();
    int getTrackPoint(PointPro& pointOut);

private:
    int initialSpeedRatioAxis();

private:

    AxisObject* speedRatioAxis;//速度比例轴
    MotionMessage *motionMessage;
    double deltaTime;
    QQueue<PointPro> pointQueue;
    PointPro endPoint;
    PointPro currentFollowPoint;
    double followSpeed;

};

#endif // FOLLOWMOTION_H
